package com.queryBuilder.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import com.queryBuilder.dao.IUsersDao;
import com.queryBuilder.entity.User;

@Repository	//�洢��ע��
public class UsersDaoImpl  implements IUsersDao{
	
	@Resource
	private HibernateTemplate hibernateTemplate;
	
	/**
	 * ��¼��֤
	 */
	@SuppressWarnings("unchecked")  //���澲Ĭ
	public User checkLogin(User users){
		//��¼��֤��ѯ
		List<User>  list = hibernateTemplate.find("from Users where usersname = ? and password = ?",new Object[]{users.getName(),users.getPassword()}); 
		if(list.size() > 0){
			return list.get(0);
		}
		
		return null;
	}

}
